package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	pb "qq_service/save_file/protobuf/pb"
)

func SaveFile(QQ []string, Email string, Word string) ([]string, string, string) {

	const Address = "127.0.0.1:6000"
	conn, err := grpc.Dial(Address, grpc.WithInsecure())
	if err != nil {
		fmt.Println(err)
	}
	defer conn.Close()

	c := pb.NewSaveFileServiceClient(conn)
	req := &pb.QqListRequest{Qq: QQ, Email: Email, Word: Word}
	res, err := c.SaveFile(context.Background(), req)
	if err != nil {
		fmt.Println(err)
	}
	return res.QqPath, res.Email, res.Word
	//fmt.Println("收到",res.q_qpath)
	//fmt.Println("收到",res.Email)
	//fmt.Println("收到",res.Word)
}
